package jeju.daum.controller;

import jeju.daum.model.User;
import jeju.daum.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
@RequestMapping(value="/modify", method=RequestMethod.POST)
public class ModifyController {

	@Autowired UserService userService;
	
	@RequestMapping
	public User showFrom(@RequestParam String id){
		return userService.getUser(id);
	}
	
	
	@RequestMapping(value="/modify/join", method=RequestMethod.POST)
	public void update(@RequestParam User user){
		userService.modifyUser(user);
	}
}
